package com.leo.common.core.constant;

/**
 * <p>
 * SecurityConstants
 * </p>
 *
 * @author ：Leo
 * @since ：2021-03-01 11:39
 */
public class SecurityConstants {

	/**
	 * 刷新
	 */
	public static final String REFRESH_TOKEN = "refresh_token";

	/**
	 * 验证码有效期
	 */
	public static final int CODE_TIME = 60;

	/**
	 * 验证码长度
	 */
	public static final String CODE_SIZE = "4";

	/**
	 * 角色前缀
	 */
	public static final String ROLE = "ROLE_";

	/**
	 * 前缀
	 */
	public static final String BYSK_PREFIX = "bysk_";

	/**
	 * oauth 相关前缀
	 */
	public static final String OAUTH_PREFIX = "oauth:";

	/**
	 * 项目的license
	 */
	public static final String LICENSE = "made by jz";

	/**
	 * 内部
	 */
	public static final String FROM_IN = "Y";

	/**
	 * 标志
	 */
	public static final String FROM = "from";

	/**
	 * OAUTH URL
	 */
	public static final String OAUTH_TOKEN_URL = "/oauth/token";

	/**
	 * {bcrypt} 加密的特征码
	 */
	public static final String BCRYPT = "{bcrypt}";

	/**
	 * sys_oauth_client_details 表的字段，不包括client_id、client_secret
	 */
	public static final String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
			+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
			+ "refresh_token_validity, additional_information, autoapprove";

	/**
	 * JdbcClientDetailsService 查询语句
	 */
	public static final String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS + " from sys_oauth_client_details";

	/**
	 * 默认的查询语句
	 */
	public static final String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";

	/**
	 * 按条件client_id 查询
	 */
	public static final String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

	/**
	 * 客户端模式
	 */
	public static final String CLIENT_CREDENTIALS = "client_credentials";

	/**
	 * AES 加密
	 */
	public static final String AES = "aes";

	public static final String SIGNINGKEY = "123bysk123bysk123bysk123bysk123bysk";

}
